var loginForm = function () {

    return {
        
        //Registration Form
        initLoginForm: function () {
	        // Validation       
	        $("#registerDataForm").validate({                   
	            // Rules for form validation
	            rules:
	            {
	                username:
	                {
	                    required: true
	                },
	                password:
	                {
	                    required: true,
	                    minlength: 6,
	                    maxlength: 16
	                }
	            },
	            
	            // Messages for form validation
	            messages:
	            {
	                username:
	                {
	                    required: '用户名不能为空'
	                },
	                password:
	                {
	                    required: '密码不能为空',
						maxlength: $.validator.format( "密码长度必须小于 {0} 位" ),
						minlength: $.validator.format( "密码长度必须大于 {0} 位" )
	                }
	            },                  
	            
	            // Do not change code below
	            errorPlacement: function(error, element)
	            {
	                error.insertAfter(element.parent());
	            }
	        });
        }

    };
}();